﻿using System;

namespace DuckFlyWithInterface
{
    class Program
    {
        static void Main(string[] args)
        {
            Duck duck1 = new Shelduck();
            Duck duck2 = new RedheadDuck();
            Duck duck3 = new RobberDuck();

            Console.WriteLine("=== 麻鸭 ===");
            duck1.Display();
            duck1.performFly();
            duck1.performQuack();
            duck1.performSwim();
            Console.WriteLine();

            Console.WriteLine("=== 红头鸭 ===");
            duck2.Display();
            duck2.performFly();
            duck2.performQuack();
            duck2.performSwim();
            Console.WriteLine();

            Console.WriteLine("=== 橡皮鸭 ===");
            duck3.Display();
            duck3.performFly();
            duck3.performQuack();
            duck3.performSwim();
            Console.WriteLine();

            Console.WriteLine("=== 动态改变橡皮鸭的行为 ===");
            duck3.changeFlyBehavior(new FlyWithRocket());
            duck3.changeQuackBehavior(new LoudQuack());
            duck3.changeSwimBehavior(new FastSwim());

            duck3.Display();
            duck3.performFly();
            duck3.performQuack();
            duck3.performSwim();
        }
    }
}